home *** CD-ROM | disk | FTP | other *** search
- Path: galileo.carl.org!echadez
- From: echadez@galileo.carl.org (Edward Chadez)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Datatypes, datatypes, datatypes
- Date: 29 Jan 1996 19:37:46 GMT
- Organization: CARL Corporation
- Message-ID: <4ej7ma$2g6@hermes.cair.du.edu>
- NNTP-Posting-Host: galileo.carl.org
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
- X-Newsreader: TIN [version 1.2 PL2]
-
- I have two problems with using datatypes (for image conversion) that perhaps
- someone here might have the answer to.
-
- The first problem is converting a GIF with only 16 colors to display on a
- screen of 256 colors. (An example of a GIF with only 16 colors is the
- 'Aminet.gif' logo at http://ftp.wustl.edu/~aminet/)
-
- struct Screen *screen; // points to an open screen
- char *file_name; // points to a string array with a valid filename
-
- obj = NewDTObject(file_name,
- DTA_SourceType, DTST_FILE,
- DTA_GroupID, GID_PICTURE,
- PDTA_Remap, TRUE,
- PDTA_Screen, screen,
- OBP_Precision, PRECISION_EXACT,
- TAG_DONE);
-
- I know that the object has been created, I can examine the BitMapHeader and
- see that the depth = 4. I convert the object to a bitmap via the call:
-
- if (GetDTAttrs(obj,
- PDTA_BitMap, &bmap,
- TAG_DONE);
-
- However, when I blit this bitmap into a new bitmap into the window's
- rastport with a minturn of 0xE0 (or 0xC0), I get an image with false
- colors, as if it's trying to account for all 8 bitplanes when there are
- only 4. I've tried using BltBitMap with various masks (7, 15, 65) but
- I get the same results (using a mask of 1 or 3 provides different, but
- still incorrect results).
-
- == == == == == == == == == == == == ==
-
- My second problem: is there an easy way to build a mask from a bitmap with
- a transparent attribute by just knowing the transparent color?
-
- I'd like to convert a gif (with a transparent color) to a bitmap and
- then blit it to another bitmap, ignoring (ie, masking) the areas with
- the transparent color. (If there's an easier way to do this, I'm all
- ears....)
-
- As always...thanks in advance.
-
- -Ed
- --
- What you percieve here as opinions aren't readily shared by those I work for.
- Edward Chadez, Lead Senior Programmer/Analyst at CARL Corporation
- When web surfing, visit Galileo's Universe at http://galileo.carl.org/
- Amiga user since 1988. Internet surfer since 1989. Grow up, not old.
-